<div id="page-wrapper">
	<div class="row">
		<div class="col-lg-12">
			<h4 class="page-header">DATA TABEL TRAKD</h4>
		</div>
		<!-- /.col-lg-12 -->
	</div>
	<!-- /.row -->
	<div class="row">
		<div class="col-lg-12">
			<div class="panel panel-default">
				<div class="panel-heading">
					DataTables Dari Table TRAKD
				</div>
				<!-- /.panel-heading -->
				<div class="panel-body">
					<div class="table-responsive">
						<table id="trakd" class="table table-striped table-bordered table-hover" id="dataTables-example">
							<thead>
								<tr>
									<th>THSMSTRAKD</th>
									<th>KDPTITRAKD</th>
									<th>KDJENTRAKD</th>
									<th>KDPSTTRAKD</th>
									<th>NODOSTRAKD</th>
									<th>KDKMKTRAKD</th>
								</tr>
								<tr>
									<th>THSMSTRAKD</th>
									<th>KDPTITRAKD</th>
									<th>KDJENTRAKD</th>
									<th>KDPSTTRAKD</th>
									<th>NODOSTRAKD</th>
									<th>KDKMKTRAKD</th>
								</tr>
							</thead>
						</table>
					</div>
					<!-- /.table-responsive -->
				</div>
				<!-- /.panel-body -->
			</div>
			<!-- /.panel -->
		</div>
		<!-- /.col-lg-12 -->
	</div>
</div>
<script type="text/javascript">
	$(document).ready(function() {	
		editor = new $.fn.dataTable.Editor( {
			"ajaxUrl": "<?php echo $this->location('trakd/init'); ?>",
			"domTable": "#trakd",
			"fields": [ {
				}, {
					"label": "THSMSTRAKD",
					"name": "THSMSTRAKD"
				}, {
					"label": "KDPTITRAKD",
					"name": "KDPTITRAKD"
				}, {
					"label": "KDJENTRAKD",
					"name": "KDJENTRAKD"
				}, {
					"label": "KDPSTTRAKD",
					"name": "KDPSTTRAKD"
				}, {
					"label": "NODOSTRAKD",
					"name": "NODOSTRAKD"
				},{
					"label": "KDKMKTRAKD",
					"name": "KDKMKTRAKD"
				}
			]
		} );
	 
		
		var oTable = $('#trakd').dataTable( {
			"sDom": "<'row'<'col-xs-2'l><'col-xs-5'T><'col-xs-4'f>r>t<'row'<'col-xs-6'i><'col-xs-6'p>>",
			"sAjaxSource": "<?php echo $this->location('trakd/init'); ?>",
			"bProcessing": true,
			"bServerSide": true,
			"sServerMethod": "POST",
			"iDisplayLength": 55,
			"aLengthMenu": [[50, 100, 200, -1], [50, 100, 200, "All"]],
			"aoColumns": [
				{ "mDataProp": "THSMSTRAKD","sWidth": "auto" },
				{ "mDataProp": "KDPTITRAKD","sWidth": "auto" },
				{ "mDataProp": "KDJENTRAKD","sWidth": "auto" },
				{ "mDataProp": "KDPSTTRAKD","sWidth": "auto" },
				{ "mDataProp": "NODOSTRAKD","sWidth": "auto" },
				{ "mDataProp": "KDKMKTRAKD","sWidth": "auto" }
			],
			"oTableTools": {
				"sRowSelect": "multi",
				"sSwfPath": "<?php echo $this->uri->baseUri;?>assets/default/js/plugins/dataTables/copy_csv_xls_pdf.swf",
				"aButtons": [
					{ "sExtends": "editor_create", "editor": editor,"sButtonText":"New", },
					{ "sExtends": "editor_edit",   "editor": editor,"sButtonText":"Edit", },
					{ "sExtends": "editor_remove", "editor": editor,"sButtonText":"Delete", },
					{ "sExtends":
						"gotoURL",
						"sButtonText":"goto URL",
						"sGoToURL": "<?php echo $this->location('trakd');?>",
						"fnClick": function( nButton, oConfig ) {
							if($(nButton).hasClass('disabled')) {
								return false;
							};
							var d = this.fnGetSelectedData();
							tabel_role(d[0].DT_RowId);
						}
					},
					"copy",
					"print",
					{
						"sExtends":    "collection",
						"sButtonText": 'Save <span class="caret" />',
						"aButtons":    [ "csv", "xls", "pdf" ]
					}
				]
			}
		}).columnFilter({
			sPlaceHolder: "head:after"
		});
	} );
</script>